<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div th:fragment="head" style="font-size: 20px">
    <th:block  th:if="${#session.getAttribute('userName') != '空'}">
        <img  style="width: 30px;height: 30px;border-radius: 50%"
              th:src="@{'/images/'+${#session.getAttribute('photo')}}">
    </th:block>
    <th:block  th:if="${#session.getAttribute('userName') != '空'}">
        <span th:text="${#session.getAttribute('userName')}"></span>
    </th:block>
    <a th:href="@{/}">文章管理系统</a>
    <th:block th:if="${#session.getAttribute('userName') == '空'}">
        <a th:href="@{/tologin}">登录</a>
    </th:block>
    <th:block th:if="${#session.getAttribute('userName') == '空'}">
        <a th:href="@{/toRegister}">注册</a>
    </th:block>
    <a th:href="@{/back/index}" >后台</a>
    <th:block th:if="${#session.getAttribute('userName') != '空'}">
        <a th:href="@{/logout}">注销</a>
    </th:block>
</div>
</body>
</html>